var Meter = (function(window) {
	var Meter = function(chartId) {
		return new Meter.fn.init(chartId)
	}

	Meter.fn = Meter.prototype = {
		constructor : Meter,
		init : function(chartId) {
			this.chartDom = document.getElementById(chartId)
			this.chart = echarts.init(this.chartDom)
			this.option = {
				series : [ {
					type : 'gauge',
				    max: 380,
					axisLine : {
						lineStyle : {
							width : 8,
							color : [ [ 0.3, '#07e5ff' ], [ 0.7, '#ffe400' ],
									[ 1, '#ff6316' ] ]
						}
					},
					pointer : {
						itemStyle : {
							color : 'auto'
						}
					},
					axisTick : {
						show : false
					},
					splitLine : {
						show : false
					},
					axisLabel : {
						show : false
					},
					title: {
				        offsetCenter: [0, '80%'],
				        color : 'auto',
				        fontSize: 16
				      },
					detail : {
						valueAnimation : true,
						formatter : '{value}',
						color : 'auto',
						fontSize:20
					},
					data : [ {
						value : 0,
						name:''
					} ]
				} ]
			}
			this.initChart()
		},
		initChart:function(){
			this.option && this.chart.setOption(this.option)
		},
		setMeterOption : function(option) {
			this.chart.setOption(option)
		}
	}

	Meter.fn.init.prototype = Meter.fn
	return Meter
})()


